package com.infoauto.opc.gateway.controller;

import com.infoauto.opc.gateway.entity.Result;
import com.infoauto.opc.gateway.entity.ResultCode;
import com.infoauto.opc.gateway.model.gtm4.ControlSignalProject;
import com.infoauto.opc.gateway.model.gtm4.ControlSignalStation;
import com.infoauto.opc.gateway.service.ControlSignalProjectService;
import com.infoauto.opc.gateway.service.ControlSignalStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 控制信号项目
 */

@CrossOrigin
@RestController
@RequestMapping("/controlSignalProject")
public class ControlSignalProjectController {
    @Autowired
    private ControlSignalProjectService service;

    @RequestMapping(value="/selectByStationId" ,method= RequestMethod.GET)
    public Result selectByStationId(Integer stationId){
        try{
            List<ControlSignalProject> list = service.selectByStationId(stationId);
            return new Result(ResultCode.SUCCESS,list);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

}
